package com.shawbs.vueblog.comom;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Result {
    private int code;
    private String msg;
    private Boolean success;
    private Object data;

    public static Result success(Object data) {
        return new Result(200,"请求成功",true,data);
    }

    public static Result success(String msg, Object data) {
        return new Result(200,msg,true,data);
    }

    public static Result fail( int code, String msg) {
        return new Result(code,msg,false,null);
    }
}
